package com.ruoyi.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.ProjectContractMapper;
import com.ruoyi.domain.ProjectContract;
import com.ruoyi.service.IProjectContractService;
import com.ruoyi.common.core.text.Convert;

import javax.xml.crypto.Data;

/**
 * 项目合同Service业务层处理
 *
 * @author ruoyi
 * @date 2020-06-22
 */
@Service
public class ProjectContractServiceImpl implements IProjectContractService {
    @Autowired
    private ProjectContractMapper projectContractMapper;

    /**
     * 查询项目合同
     *
     * @param pId 项目合同ID
     * @return 项目合同
     */
    @Override
    public ProjectContract selectProjectContractById(Long pId) {
        return projectContractMapper.selectProjectContractById(pId);
    }

    @Override
    public List<ProjectContract> selectProjectContractlistss(Long sId) {
        return projectContractMapper.selectProjectlistss(sId);
    }

    /**
     * 查询项目合同列表
     *
     * @param projectContract 项目合同
     * @return 项目合同
     */
    @Override
    public List<ProjectContract> selectProjectContractList(ProjectContract projectContract) {
        return projectContractMapper.selectProjectContractList(projectContract);
    }

    /**
     * 新增项目合同
     *
     * @param projectContract 项目合同
     * @return 结果
     */
    @Override
    public int insertProjectContract(ProjectContract projectContract) {
        projectContract.setpCreate(new Date());
        return projectContractMapper.insertProjectContract(projectContract);
    }

    /**
     * 修改项目合同
     *
     * @param projectContract 项目合同
     * @return 结果
     */
    @Override
    public int updateProjectContract(ProjectContract projectContract) {
        return projectContractMapper.updateProjectContract(projectContract);
    }

    /**
     * 删除项目合同对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteProjectContractByIds(String ids) {
        return projectContractMapper.deleteProjectContractByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除项目合同信息
     *
     * @param pId 项目合同ID
     * @return 结果
     */
    @Override
    public int deleteProjectContractById(Long pId) {
        return projectContractMapper.deleteProjectContractById(pId);
    }


    /**
     * 导出
     *
     * @param projectContract 付款申请单信息
     * @return 付款申请单信息集合信息
     */
    @Override
    public List<ProjectContract> selectUserexport(ProjectContract projectContract) {
        return projectContractMapper.selectUserexport(projectContract);
    }
}
